<?php
/*
Uploadify
Copyright (c) 2012 Reactive Apps, Ronnie Garcia
Released under the MIT License <http://www.opensource.org/licenses/mit-license.php> 
*/

// Define a destination
$targetFolder = dirname(__FILE__) . '/../../../../uploads/images/com_pgb'; // Relative to the root

$verifyToken = md5('unique_salt' . $_POST['timestamp']);

if (!empty($_FILES) && $_POST['token'] == $verifyToken) {
	$tempFile = $_FILES['Filedata']['tmp_name'];
	$targetPath = $targetFolder;
    
    $name = explode('.', $_FILES['Filedata']['name']);
    $name = 'do'.$_POST['DOCK_CODE'].'_'.date("Y-m-d_H-i",time())."_".$_POST['STT'].'.'.end($name);
	$targetFile = rtrim($targetPath,'/') . '/' . $name;
    
    move_uploaded_file($tempFile,$targetFile);
    echo $name;
     
}
?>